package com.tico.common.utils;

import org.hibernate.internal.util.StringHelper;
import org.nutz.lang.segment.CharSegment;
import org.springframework.util.StringUtils;

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringReplace {
    public static String replaceStr(String url,String replaceStr){
        String chembo = url.replaceAll("\\{\\{[^}]*}}/i", replaceStr);
        return chembo;
    }

    public static void main(String[] args) {
        String url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal/${yes}/${no}";
        CharSegment charSegment =  new CharSegment(url);
        charSegment.set("yes","aa");
        charSegment.set("no","bb");
        System.out.println(charSegment.toString());
    }



}
